#ifndef PROXY_H
#define PROXY_H
#include <iostream>
#include "javabean.h"

using namespace std;

class Interface{
public:
    virtual void Request()=0;
};

class RealClass:public Interface{
public:
    virtual void Request() {
        cout<<"真是的请求"<<endl;
    }
};

class ProxyClass:public Interface{
    PointerPropertyBuilderByName(RealClass,realClass,private)
    //在该代理类中代理其他对象
    virtual void Request() {
        m_realClass=new RealClass();
        cout<<"before call"<<endl;
        m_realClass->Request();
        cout<<"after call"<<endl;
        delete m_realClass;
    }
};

#endif // PROXY_H
